package com.scau.hwadee.examination.mapper;

import com.scau.hwadee.examination.entity.Course;
import com.scau.hwadee.examination.entity.Examcourse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author YHX
 * @date 2019/7/29  9:01
 * @description
 */
@Mapper
public interface CourseMapper {
    int deleteByPrimaryKey(String csId);

    int insert(Course record);

    int insertSelective(Course record);

    Course selectByPrimaryKey(String csId);

    int updateByPrimaryKeySelective(Course record);

    int updateByPrimaryKey(Course record);

    int insertCourseListByExcel(@Param("list") List<Course> courses);

    List<Course> selectAllCourses2ExportExcel();

    List<Course> selectAllCourse(@Param("pageNum") int pageNum,
                                 @Param("pageSize") int pageSize,
                                 @Param("majorVersionId") String majorVersionId);

    int updateCourseState(@Param("list") List<Course> courses);

    List<Course> selectAllPracticalOrTheoreticalCourse(@Param("pageNum") int pageNum,
                                                       @Param("pageSize") int pageSize,
                                                       @Param("csProperty") String property,
                                                       @Param("mvId")String mvId);

    List<Map<String, Object>> selectExamOpeningCourseSummary(@Param("pageNum") int pageNum,
                                                             @Param("pageSize") int pageSize,
                                                             @Param("list") List<Examcourse> examcourses);

    /**
     * @return java.util.List<com.scau.hwadee.examination.entity.Course>
     * @author YHX
     * @description 获取某专业下的所有课程
     * @date 14:38 2019/8/3
     * @Param []
     **/
    List<Course> selectAllCourseOfMajor(@Param("pageNum") int pageNum,
                                        @Param("pageSize") int pageSize,
                                        @Param("majorId") String majorId);
}